<?php
header("content-type:text/html;charset=utf-8");

//获取客户端传入的参数
$n=$_GET['username'];
$p=$_GET['password'];

$link=mysqli_connect("localhost",'root','','shop');
//设置编码
mysqli_set_charset($link,"utf8");

//SQL语句
$sql="select * from user1 where id='$n' and name='$p'";
//执行SQL，并返回结果集
$result=mysqli_query($link,$sql);
//检查结果集中是否有数据
if(mysqli_fetch_row($result)){
    echo "1";
}else{
    echo "0";
}

?>